﻿<UserControl x:Class="Jade.Tools.SL.Controls.ImageViewer.Viewer"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:Jade.Tools.SL.Controls.ImageViewer"
    xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    mc:Ignorable="d"
    Height="auto" Width="auto">


    <UserControl.Resources>

        <!-- scroll viewer -->
        <Style x:Key="ScrollViewerStyle" TargetType="ScrollViewer">
            <Setter Property="HorizontalScrollBarVisibility" Value="Hidden" />
            <Setter Property="VerticalScrollBarVisibility" Value="Hidden" />
        </Style>

    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">

        <ScrollViewer Grid.Row="0" x:Name="ScrollViewer" Margin="0" Padding="0" Style="{StaticResource ScrollViewerStyle}" controlsToolkit:ScrollViewerExtensions.IsMouseWheelScrollingEnabled="True" >
            <Viewbox x:Name="viewbox" VerticalAlignment="Top" HorizontalAlignment="Left">
                <ItemsControl x:Name="ItemsControl">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <local:ColumnedPanel Loaded="OnPanelLoaded"    
                                             Height="1000" VerticalAlignment="Center">
                                <!--<local:ColumnedPanel.RenderTransform>
                                    <ScaleTransform x:Name="scaleTransformPanel" ScaleX="1" ScaleY="1"/>
                                </local:ColumnedPanel.RenderTransform>-->
                            </local:ColumnedPanel>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
            </Viewbox>
        </ScrollViewer>
    </Grid>
</UserControl>
